package com.xxx.coll;

import java.util.Comparator;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/21 10:23
 * @Copyright 博为峰
 */

//比较器类
public class ComparatorImpl implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        Worker worker1 = (Worker) o1;
        Worker worker2 = (Worker) o2;
        return worker1.getAge() - worker2.getAge();
    }
}
